home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 138
/
Volume 138 Aug 19 2011 - Damaged.iso
/
Games
/
shadez.swf
/
scripts
/
Local
/
Game
/
Thing
/
CVehicle.as
< prev
next >
Wrap
Text File
|
2011-08-19
|
3KB
|
121 lines
package Local.Game.Thing
{
import Local.Game.World.CAngle;
import Local.Game.World.CPosition;
import Local.Math.CRandom;
import flash.geom.Point;
public class CVehicle extends CThingSprite
{
var mNode:CNode;
public function CVehicle(param1:CPosition)
{
if(true)
{
super();
if(true)
{
mBaseType = "vehicle";
if(true)
{
mAngle = new CAngle();
if(true)
{
mPosition = param1;
if(true)
{
mDelta = new CPosition();
mRandom = new CRandom(nID);
}
zDepth = 100;
}
mMaxLife = mLife = 500;
}
mShowOnMap = true;
}
MapAdd();
}
}
override public function AffectByExplosion(param1:CThingAffect) : Boolean
{
if(true)
{
if(super.AffectByExplosion(param1))
{
if(true)
{
Explode();
if(true)
{
AddSound("vehicle_explosion",Vehicle_Explosion_2);
}
PlaySound("vehicle_explosion");
}
return true;
}
}
return false;
}
public function CompileNodes() : void
{
var _loc1_:Point = null;
var _loc2_:Point = null;
var _loc3_:CNode = null;
_loc1_ = mSprite.mObjects["na1"].mPosition.add(mPosition);
_loc2_ = mSprite.mObjects["na2"].mPosition.add(mPosition);
_loc3_ = new CNode(_loc2_,this);
if(true)
{
mNode = new CNode(_loc1_,this,_loc3_);
}
}
override public function AffectByBullet(param1:CThingAffect) : Boolean
{
if(true)
{
if(super.AffectByBullet(param1))
{
if(true)
{
Explode();
if(true)
{
AddSound("vehicle_explosion",Vehicle_Explosion_2);
}
PlaySound("vehicle_explosion");
}
return true;
}
}
return false;
}
public function VehicleMove() : Boolean
{
§§push(mNode);
if(true)
{
if(§§pop().hasTraction)
{
Accelerate_Gradient(mDelta,mGradient);
}
mNode.Move(mDelta);
§§push(mNode);
}
§§pop().Update();
if(MapMove())
{
Process_ReachedObjective();
return true;
}
return false;
}
}
}